package liangtWorkSpace.factory.headFirstFactory.SimpFactory;

/**
 * @ClassName PizzaStore
 * @Description : 披萨店
 * @Author : LiangT
 * @Date : 2020/7/3 10:48
 */
public class PizzaStore {
    SimplePizzaFactory simplePizzaFactory;

    /**
     * 获取披萨工厂
     * @param simplePizzaFactory
     */
    public PizzaStore(SimplePizzaFactory simplePizzaFactory) {
        this.simplePizzaFactory = simplePizzaFactory;
    }

    /**
     * 下单
     * @param type
     */
    public void orderPizza(String type){
        Pizza pizza = simplePizzaFactory.createPizza(type);

        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
    }
}
